package mementoPattern;



/**
 * @program: course
 * @author: lsn
 * @create: 2024-05-18 16:06
 * @description: 角色：原发者
 */
public class Originator {
    private String state;

    public void setState(String state){
        this.state = state;
    }

    public String getState(){
        return state;
    }

    public Memento saveStateToMemento(){
        return new Memento(state);
    }

    public void getStateFromMemento(Memento Memento){
        state = Memento.getState();
    }
}

